//
//  Functions.swift
//  MyLocations
//
//  Created by cygarm on 15/12/10.
//  Copyright © 2015年 cygarm. All rights reserved.
//

import Foundation
import Dispatch

/*
This is a 'free function', not a method inside an object
can be used from anywhere in your code
*/
func afterDelay(seconds: Double, closure: () -> ()) {
	let when = dispatch_time(DISPATCH_TIME_NOW, Int64(seconds * Double(NSEC_PER_SEC)))
	dispatch_after(when, dispatch_get_main_queue(), closure)
}

let applicationDocumentsDirectory: String = {
	let paths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true) as [String]
	return paths[0]
}()